CSL 332 Network Programming Lab MBCET
Faculty Manual (version 1.0) Page 17
to the destination computer and waits inorder to get the response back. Once the packets are received by the
destined computer, it starts sending the packets back. This commands keeps executing until it is
interrupted.ping command provides the details such as
▪ number of packets transmitted
▪ number of packets received
▪ time taken by the packet to return
ping command in generally used for the following purposes:
▪ measuring the time taken by the packets to return to determine speed of the connection
▪ to make sure that the network connection between host and the destined computer can be established
3. NSLOOKUP
nslookup command queries the DNS in order to fetch the IP address or the domain name from DNS
records.
4. TRACEROUTE
This command is used to get the route of a packet. In other words, traceroute command is used to determine
the path along which a packet travels. It also return the number of hops taken by the packet to reach the
destination. This command prints to the console, a list of hosts through which the packet travels in order to
the destination.
5. HOST
host command is used to find domain name associated with the IP address or find IP address associated with
domain name. The returned IP address is either IPv4 or IPv6.
6. NETSTAT
netstat(Network Statistics) is the command that is used to display routing table, connection information, status
of ports, etc. This command works with Linux Network Subsystem. This command basically displays the
content of /proc/net file defined in linux file system.
7. DIG Command
Dig (domain information groper) query DNS related information like A Record, CNAME, MX Record etc.
This command mainly used to troubleshoot DNS related query.
8. ROUTE Command
route command shows and manipulate ip routing table.
Network Configuration File
Every operating system stores network configuration information in files.Some of these files specify
information about the host’s address and host name, or unique setup parameters. Other files specify which
network services the host will allow, and which other hosts on the network provide services the host may
require.
1. /etc/hosts File
– One of the most frequently used network administration files is the /etc/hosts file
(/etc/inet/hosts on System V machines).
– The file is a registry of IP addresses and associated host names known to a system.
– At a minimum, it must contain the loop-back address (127.0.0.1) and the IP address for the
host.
– The hosts file is one of the resources consulted by applications in order to resolve a host name
to an IP address when communications are requested.